home *** CD-ROM | disk | FTP | other *** search
/ MacFormat España 15 / macformat_15.iso / C de cerca / Codewarrior Lite / MacOS Support / Headers / ANSI Headers / string.h < prev    next >
Text File  |  1995-12-29  |  3KB  |  121 lines

  1. /* string.h standard header */
  2. #ifndef _STRING
  3. #define _STRING
  4. #ifndef _YVALS
  5. #include <yvals.h>
  6. #endif
  7.  
  8. #if __MWERKS__
  9. #pragma options align=mac68k
  10.  
  11. #if __CFM68K__ && __USING_IMPORTED_ANSI__
  12. #pragma import on
  13. #endif
  14. #endif
  15.  
  16.         /* externally set this to 1 in order to force ANSI calls for string inlines */
  17. #ifndef _NO_FAST_STRING_INLINES_
  18. #define _NO_FAST_STRING_INLINES_ 0
  19. #endif
  20.  
  21.         /* macros */
  22. #ifndef NULL
  23. #define NULL    _NULL
  24. #endif
  25.         /* type definitions */
  26. #ifndef _SIZET
  27. #define _SIZET
  28. typedef _Sizet size_t;
  29. #endif
  30.         /* declarations */
  31. _C_LIB_DECL
  32. int memcmp(const void *, const void *, size_t);
  33. void *memmove(void *, const void *, size_t);
  34. void *memset(void *, int, size_t);
  35. char *strcat(char *, const char *);
  36. int strcmp(const char *, const char *);
  37. int strcoll(const char *, const char *);
  38. size_t strcspn(const char *, const char *);
  39. char *strerror(int);
  40. char *strncat(char *, const char *, size_t);
  41. int strncmp(const char *, const char *, size_t);
  42. char *strncpy(char *, const char *, size_t);
  43. size_t strspn(const char *, const char *);
  44. char *strtok(char *, const char *);
  45. size_t strxfrm(char *, const char *, size_t);
  46. char *_Strerror(int, char *);
  47. _END_C_LIB_DECL
  48.  
  49. #if !__MC68K__ || _NO_FAST_STRING_INLINES_
  50.  
  51. _C_LIB_DECL
  52. size_t strlen(const char *);
  53. char *strcpy(char *, const char *);
  54. void *memcpy(void *, const void *, size_t);
  55. _END_C_LIB_DECL
  56.  
  57. #else /* !(!__MC68K__ || _NO_FAST_STRING_INLINES_) */
  58.  
  59. _C_LIB_DECL
  60. size_t __strlen(const char *:__A0):__D0 = { 0x70FF,0x5280,0x4A18,0x66FA };
  61. char *__strcpy(char *:__A0,const char *:__A1):__D0 = { 0x2008,0x10D9,0x66FC };
  62. char *__memcpy(void *:__A0,const void *:__A1,size_t:__D1):__D0 = { 0x2008,0x4A81,0x6706,0x10D9,0x5381,0x66FA };
  63. _END_C_LIB_DECL
  64.  
  65. #ifdef __cplusplus
  66.         /* double inlines, for C++ */
  67. inline size_t strlen(const char *x)                        { return (__strlen(x)); }
  68. inline char *strcpy(char *x, const char *y)                { return (__strcpy(x,y)); }
  69. inline void *memcpy(void *x, const void *y, size_t z)    { return (__memcpy(x,y,z)); }
  70. #else
  71.         /* double macro overrides, for C */
  72. size_t strlen(const char *);
  73. char *strcpy(char *, const char *);
  74. void *memcpy(void *, const void *, size_t);
  75. #define strlen(x)        __strlen(x)
  76. #define strcpy(x,y)        __strcpy((x),(y))
  77. #define memcpy(x,y,z)    __memcpy((x),(y),(z))
  78. #endif
  79.  
  80. #endif /* !__MC68K__ || _NO_FAST_STRING_INLINES_ */
  81.  
  82. _C_LIB_DECL
  83. void *memchr(const void *, int, size_t);
  84. char *strchr(const char *, int);
  85. char *strpbrk(const char *, const char *);
  86. char *strrchr(const char *, int);
  87. char *strstr(const char *, const char *);
  88. _END_C_LIB_DECL
  89.  
  90. #ifdef __cplusplus
  91.         /* inlines and overloads, for C++ */
  92. #define _Const_return const
  93. inline char *strerror(int _Err)
  94.     {return _Strerror(_Err, 0); }
  95. #else
  96. #define _Const_return
  97.         /* macro overrides, for C */
  98. #define strerror(err)    _Strerror(err, 0)
  99. #endif
  100.  
  101. #if __MWERKS__
  102. #if __CFM68K__ && __USING_IMPORTED_ANSI__
  103. #pragma import reset
  104. #endif
  105.  
  106. #pragma options align=reset
  107. #endif
  108.  
  109. #endif
  110.  
  111.  
  112. /*
  113.  * Copyright (c) 1994 by P.J. Plauger.  ALL RIGHTS RESERVED. 
  114.  * Consult your license regarding permissions and restrictions.
  115.  */
  116.  
  117. /* Change log:
  118.  *94June04 PlumHall baseline
  119.  *94Oct07 Inserted MW changes.
  120.  */
  121.